<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Element </title>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
		}

	</style>
	<script type="text/javascript">
		window.onload = function  () {
			box = document.getElementById('box');
			box.onclick = function  (argument) {
	

			boxwidth = window.getComputedStyle ? window.getComputedStyle(box,null).width : box.currentStyle.width;
			alert(boxwidth);

			}
			// imgtest.onclick = function  () {
			// 	imgtest.src="https://www.sogou.com/index/images/logo_440x140.png";
			// }

			// var res = imgtest.getAttribute('xbs');

			// imgtest.setAttribute('xbs',"学并思大牛");

		}
	</script>
</head>
<body>
	<div  class="box" xbs='学并思' id="box"><p>学并思</p></div>
	<!-- <img xbs='学并思' src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png" alt="" id="imgtest"> -->
</body>
</html>